This invention relates to computer systems, and more specifically to a method and system for conversion between a relational database and an XML document.
The WWW is a distributed hypermedia system constructed on the Internet, a global system of heterogeneous networked computers. Advances in networking and Web/Internet technology are leading to a network-centric computing model, and the Web and Internet are evolving into the infrastructure for global network computing. By populating this infrastructure with object-based components and combining them in various ways, one can enable the development and deployment of interoperable distributed object systems on the Web. The marriage of the Web with objects presents a compelling computing model. The object model provides the ability to mimic real world process in a fluid, dynamic and natural way. The Web allows for objects to be distributed to servers thereby centralizing access, processing, and maintenance, provides a multiplexing interface to distributed objects, and allows thin-clients. There is an emergence of an industry that provides Web and object interfaces to distributed object tools. Additionally, the Web is considered to be the platform for next-generation business applications. Business objects mirror the business itself, allow process, policy, data and definitions to be shared, and enable the business process to be re-engineered.
XML (extensible markup language) is a markup language for documents containing structured information. Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays or an indication of relationships between the content items. A markup language is a mechanism to identify these structures in a document. The XML specification defines a standard way to add markup to documents, and was created so that richly structured documents could be used over the web. XML documents have three major features. The first feature is that Elements have a name, zero or more attributes, and zero or more children where these children may be either text or additional elements. Second, Attributes are name/value pairs that appear inside of elements, and finally, Arbitrary text may appear within an element.
The XML markup language has several properties that make it useful for representing business data. XML documents are hierarchicalxe2x80x94each element in the document has a parent (except the document root, which has no parent) and zero or more children. The ordering of elements and text in a document is significant and there are standard xe2x80x9cmetadataxe2x80x9d formats for defining the allowable structures of a document that includes DTD and XML Schema.
Most business data is stored at some point in a relational database. Relational databases have a different structure for representing data than XML documents. Relational schemas contain a set of tables where each table contains an un-ordered set of records that have a fixed set of data fields known as columns. Tables are related to each other through foreign key relationships, which may take the form of an arbitrary graph. Business applications may access this database directly or provide a layer of software on the data model that is more convenient for access in memory.
XML is frequently used to pass business data between applications or partner companies, while the relational data model is used for the internal storage of the same data. This implies that the data must be transformed between the relational representation and the XML representation. This can be labor intensive if software must be written for each unique XML document type.
A method to convert data between a relational format and an XML document, by creating a set of XML Mapping Definition metadata from XML schema metadata or DTD using a Wizard. Relational data can be selected from a relational application database and converted to an XML document using the set of XML Mapping Definition.
The method can convert an XML document back to the relational data using the set of XML Mapping Definition; and the relational data converted from the XML document can be stored in an application database.